﻿using System;
using Nest;

namespace EsSample
{
    /// <summary>
    /// ES客户端工厂
    /// </summary>
    public class EsClientFactory
    {
        private static string _node = "http://192.168.7.22:9200";
        /// <summary>
        /// 返回一个ES的客户端实例
        /// </summary>
        public static ElasticClient GetClient 
        {
            get
            {
                var node = new Uri(_node);
                var settings = new ConnectionSettings(node);
                return new ElasticClient(settings);
            }
        }
    }
}